/*
 * This file (AkRotating.java) is protected by the GNU GPL licence (v2). 
 * Please read the license.txt attached for further informations. 
 * 
 */

package alkwarel.brushes;

import alkwarel.objects.AkArtspace;
import alkwarel.objects.AkStampBrush;

/**
 * @author Xavier Gouchet
 *
 */
public class AkRotating extends AkStampBrush {

	private float angle;
	private float inc;
	private float weight;
	
	/**
	 * Standard Constructor
	 */
	public AkRotating() {
		super(2, "Rotating");
		this.angle = 0;
		this.weight = 10;
		this.inc = (float) (3.141592653 * 0.05);
	}


	/**
	 * @see alkwarel.objects.AkStampBrush#DrawStamp(alkwarel.objects.AkArtspace, float, float)
	 */
	public void DrawStamp(AkArtspace a, float posx, float posy) {
		float dx, dy;
		dx = (float) (Math.cos(this.angle) * this.weight);
		dy = (float) (Math.sin(this.angle) * this.weight);
		a.line(posx+dx, posy+dy, posx-dx, posy-dy);
		this.angle += this.inc;
	}


}
